﻿using System;
using fastCSharp;

namespace diantou.web.contest
{
    /// <summary>
    /// 用户在比赛下的提交记录
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsReferer = false)]
    partial class userSubmitList : web.user.view<userSubmitList>
    {
        /// <summary>
        /// 用户提交问题列表
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private submitList.problemJudge[] problems;
        /// <summary>
        /// 用户的提交记录
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="contestId"></param>
        /// <param name="page">分页号</param>
        /// <returns>是否成功</returns>
        private bool loadView(int userId, int page)//, int contestId
        {
            if (base.load(userId))
            {
                diantou.dataAccess.contestJudge.problemJudge[] problemJudges = diantou.dataAccess.tcpCall.contestJudge.getUserProblems(userId, pageInfo.Size = fastCSharp.config.pub.Default.PageSize, pageInfo.Page = page, out pageInfo.Count);
                problems = problemJudges.getArray(value => new submitList.problemJudge(value, userId, currentUser));
                if (requestHeader.IsSearchEngine) pageInfo.Path = user.Path.ContestSubmit.ToPageString();
                return true;
            }
            return false;
        }
    }
}
